package com.ysd.lis.controller.qc;


import com.ysd.common.Result;
import com.ysd.lis.controller.pub.BaseController;
import com.ysd.lis.entity.qc.QcMaterial;
import com.ysd.lis.request.CommonPageDto;
import com.ysd.lis.request.MaterialItemDto;
import com.ysd.lis.service.qc.QcMaterialItemService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

/**
 * <p>
 * 员工表
 * 前端控制器
 * </p>
 *
 * @author pengrongshuai
 * @since 2023-12-19
 */
@Api(tags = "质控品项目")
@RestController
@RequestMapping("/api/qc/qcMaterialItem")
public class QcMaterialItemController extends BaseController {

    @Autowired
    QcMaterialItemService qcMaterialItemService;

    @ApiOperation("批量新增")
    @PostMapping("/batchAddMaterialItemList")
    public Result batchAddMaterialItemList(@RequestBody MaterialItemDto dto){
        return  qcMaterialItemService.batchAddMaterialItemList(dto);
    }

    @ApiOperation("查询")
    @GetMapping("/findMaterialItemList")
    public Result findMaterialItemList(CommonPageDto pageParam){
        return qcMaterialItemService.findMaterialItemList(pageParam);
    }
    @ApiOperation("根据质控物ids查询项目列表")
    @PostMapping("/findQcInstrItemListByInstrIds")
    public Result findQcInstrItemListByInstrIds(@RequestBody CommonPageDto pageParam){
        return qcMaterialItemService.findQcInstrItemListByInstrIds(pageParam);
    }

    @ApiOperation("批量删除")
    @PostMapping("/batchDeleteMaterialItemList")
    public Result batchDeleteMaterialItemList(@RequestBody MaterialItemDto dto){
        return  qcMaterialItemService.batchDeleteMaterialItemList(dto);
    }

    @ApiOperation("批量修改")
    @PostMapping("/editBatchMaterialItem")
    public Result editBatchMaterialItem(@RequestBody QcMaterial material){
        return  qcMaterialItemService.editBatchMaterialItem(material);
    }


    @ApiOperation("查询树形结构")
    @GetMapping("/findMaterialItemTree")
    public Result findMaterialItemTree(CommonPageDto pageParam){
        return qcMaterialItemService.findMaterialItemTree(pageParam);
    }

}
